package com.wanlian.router.push;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.smart.android.utils.ActivityStackManager;
import com.wanlian.router.MainActivity;
import com.wanlian.router.ui.SplashActivity;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by Hyu on 2018/10/18.
 * Email: fvaryu@163.com
 */
public class MyReceiver extends BroadcastReceiver {


    @Override
    public void onReceive(Context context, Intent intent) {

        if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) {

            if (!ActivityStackManager.getInstance().existActivity(MainActivity.class)) {
                context.startActivity(new Intent(context, SplashActivity.class));
            }

        }
    }

}
